-
Notifications
You must be signed in to change notification settings - Fork 637
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: using slices.Contains to simplify the code #7833
Conversation
Hi @dashangcun, thank you for the PR. Going forward, we will close PRs that do not have any issues attached to them. This is to be able to discuss and talk about solutions before people spend time on PRs, which have been a drain of time for both contributors and the team. I am not apposed to replacing usages like this, but I would want to have an issue, and would likely want to make sure we replace this everywhere to ensure consistency. For the time being I will close this issue, but feel free to open and issue where we can discuss and I can assign you to that :) |
OK, thanks for your guidance. I will raise an issue first, and after the maintainer discusses and agrees, I will submit the corresponding PR. |
I just submitted an issue, thank you for your guidance. #7837 |
@dashangcun can you look at the linter issue and fix that? |
45bf751
to
c566178
Compare
gci behaves very strangely. Even with the previous import order (which complies with the go specification), I will not throw an exception locally. Please approve ci, and I will track its execution results |
You need to run it with the config that is in the main folder. An easy way to run the linter on the whole project is to just run |
Signed-off-by: dashangcun <[email protected]>
Modified, this time it should be able to pass lint detection. Currently I will study it further later and submit a new PR if necessary. Thanks. |
I've had that problem with older versions of golangci-lint. Make sure you use 1.62 or higher. |
I saw a failure in e2e-fork (TestChannelUpgrade_WithFeeMiddleware_Succeeds, TestTransferChannelUpgradesTestSuite), but it seems unrelated to this modification. |
Yes, that one is a bit flaky. I will re-run and check again. I think this should be fine now, but will let you know. |
Okay. Thanks for your guidance! |
Thanks for the PR (and the patience) @dashangcun :) |
Description
Closes: #7837
This is a new function added in the go1.21 standard library, which can make the code more concise and easy to read.
Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.
docs/
).godoc
comments.Files changed
in the GitHub PR explorer.SonarCloud Report
in the comment section below once CI passes.